package com.jt.demo5;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class User {
    public static void main(String[] args) {
            //1.指定spring配置文件名称
//            String resource = "spring.xml";
            //2.启动spring容器,需求xml配置文件信息. 实例化对象 交给容器管理
//            ApplicationContext applicationContext = new ClassPathXmlApplicationContext(resource);
            ApplicationContext context=
                    new AnnotationConfigApplicationContext(SpringConfig.class);
            //3.从容器中按照类型获取对象
            context.getBean(Dog.class);
            context.getBean(Dog.class);
            context.getBean(Dog.class);

    }
}
